<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.List" %>
<%@ page import="net.zjitc.domain.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="net.zjitc.domain.Goods" %>
<%@ page import="net.zjitc.dao.GoodsDao" %>
<%@ page import="net.zjitc.dao.impl.GoodsDaoImpl" %>
<%@ page import="net.zjitc.dao.UserDao" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/6/1
  Time: 13:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap-3.4.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap-3.4.1-dist/css/bootstrap-theme.min.css">
<html>
<head>
    <title>商品</title>
    <script>
        function del(){
            if(confirm("确认删除吗")==true){
                return true
            }else{
                return false;
            }
        };
    </script>

</head>
<body>
<h2>当前登录的是:${sessionScope.user}</h2>
<h2>商品列表</h2>
<a href="${pageContext.request.contextPath}/goods/add.jsp" class="btn btn-primary btn-sm active" role="button">增加商品</a>
<table border="1">
    <tr>
        <td>编号</td>
        <td>商品名称</td>
        <td>价格</td>
        <td>操作</td>
        <td>删除</td>
        <td>修改</td>
    </tr>
    <c:forEach items="${li}" var="good" varStatus="status">
        <tr>
            <td width="50px">${status.count}</td>
            <td width="50px">${good.name}</td>
            <td width="50px">${good.price}</td>
            <td width="50px"><a href="${pageContext.request.contextPath}/detailServlet?id=${good.id}"> 详情</a></td>>
            <td width="50px"><a href="${pageContext.request.contextPath}/deleteServlet?id=${good.id}" onclick="javascript:return confirm('确认删除吗？')==true">删除</a> </td>
            <td width="50px"><a href="${pageContext.request.contextPath}/editUIServlet?id=${good.id}">修改</a> </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
